#include <QString>   //declare class QString 报错
#include <QObject>
#include <QVector>
class NetAsyncImp;
class VoicePlayerImp;

struct UserInfo{
    QString userId;
    QString userPwd;
    UserInfo(){
        userId = "";
        userPwd = "";
    }

    UserInfo(QString curUserId, QString curUserPwd):
        userId(curUserId),userPwd(curUserPwd){

    }

    //...
};


class User : public QObject{

Q_OBJECT

public:
    User();
    User(UserInfo userInfo);

    void     SetUserInfo(UserInfo& userInfo){userInfo = _userInfo;}
    void     SetServer(QString serverIp, QString serverPort);
    void     SetFilePath(QString newFilePath);

    void     Record();
    void     Play();
    void     Finish();

    int      SendMessage(QString content);
    int      ConnectServer();

    QString  GetMessage();
    UserInfo GetUserInfo(){return _userInfo;}

public slots:

    void     ReadMessage () const;

signals:
    void     InformUI() const;

private:
    UserInfo          _userInfo;           //用户的基本身份信息（id，密码...）
    NetAsyncImp*      _userSocket;         //消息收发器
    VoicePlayerImp*   _userVoicePlayer;    //语音处理器
    QString           _serverIp;           //服务器IP
    QString           _serverPort;         //服务器端口
    QVector<QString>  _friendList;         //存放好友列表
};
